import http from "../utils/request"

//获取最大楼层
const getMaxFloor = (articleId) => {
  return http.request({
    url: "/comment/getMaxFloor/" + articleId,
    method: 'get',
    data: {}
  })
}

//获取文章评论
const getCommentByArticleId = (data) => {
  return http.request({
    url: "/comment/getCommentByArticleId",
    method: 'get',
    data: data
  })
}

//获取文章子评论
const getChildComment = (data) => {
  return http.request({
    url: "/comment/getChildComment",
    method: 'get',
    data: data
  })
}


//文章发表评论
const publish = (data) => {
  return http.request({
    url: "/comment/publish",
    method: 'post',
    data: data
  })
}

//评论点赞
const commentLike = (commentId) => {
  return http.request({
    url: "/comment/like/" + commentId,
    method: 'get',
    data: {}
  })
}

//评论点踩
const commentDislike = (commentId) => {
  return http.request({
    url: "/comment/dislike/" + commentId,
    method: 'get',
    data: {}
  })
}


export {
  getMaxFloor,
  getCommentByArticleId,
  getChildComment,
  publish,
  commentLike,
  commentDislike
}
